<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
    <title><%= @title %></title>
    <%= stylesheet_link_tag 'home' ,'base' ,'themes/kathleene/style','user' ,'admin' %>
    <%= javascript_include_tag "admin_application" , 'admin'%>
    <%= javascript_include_tag :defaults %>
        <%= javascript_include_tag :fckeditor %>
    <%= calendar_date_select_includes(:locale => 'zh',:style => 'red') %>
    <%= yield(:head) %>
    <!--
    <script type="text/javascript" charset="utf-8" src="/javascripts/jquery-1.3.min.js"></script>
  <script type="text/javascript" charset="utf-8" src="/javascripts/jquery.scrollTo.js"></script>
  <script type="text/javascript" charset="utf-8" src="/javascripts/jquery.localscroll.js"></script>
    -->
  </head>
  <body>
    <div id="content">
      <% unless controller_name == "sessions" %>
        <div id="nav" class="buttons">
          <%#= button_link_tag "HOME","",:class => "button" %>
          <% if yield(:back).blank? %>
            <%#= backward_button_tag unless action_name == "index" %>
          <% else %>
            <%= yield(:back)  %>
          <% end %>
        </div>
      <% end %>
                           
      <div class="flash">
        <%if flash[:notice]%>
          <div class="message notice">
            <p><%= flash[:notice] %></p>
          </div>
        <%elsif flash[:warning]%> 
          <div class="message warning">
            <p><%= flash[:warning] %></p>
          </div>
        <%elsif flash[:error]%> 
          <div class="message error">
            <p><%= flash[:error] %></p>
          </div>
        <%end%>
      </div>
      <%=@a%>
      <div id="container">
        <div id="header">
          <h1><a href="/">网站管理系统</a></h1>
          <div id="user-navigation">
            <ul>
              
              
              <%  if current_user.blank? %>
                <li>  <%= link_to "注册" , signup_path %></li>
                <li>  <%= link_to "登陆" , login_path%></li>
              <%else%>
                <li> <%= link_to "退出" ,logout_path %></li>
                <li> <%= link_to "修改用户信息" , edit_user_path %></li>
              <%end%>
              <li>  <%= link_to "购物车" ,cart_path %></li>
            </ul>
            <div class="clear"></div>
          </div>
          
          <div id="main-navigation">
            <ul>
              <li class="first" ><a href="/#block-text">首页</a></li>
              <li class="first" ><a href="/about">公司简介</a></li>
              <li class="first" >  <%= link_to "产品列表" ,products_path %>     </li>
              <li><a href="#block-signup">咨询留言</a></li>
              <li class="active" ><a href="#block-signup">后台管理</a></li>
            </ul>
            
            <div class="clear"></div>
          </div>
        </div>
        
        
        <div id="wrapper">
          <div id="main">
            <div id="block-lists" class="block">
              <div class="secondary-navigation">
                <ul>
                  <li class="first <%= @controller.controller_path == 'admin/products' ? 'active' : '' %>  "><a href="/admin/products#block-tables">商品管理</a></li>
                  <li class=" <%= @controller.controller_path == 'admin/articles' ? 'active' : '' %>  "><a href="/admin/articles">博客管理</a></li>
                  <li class=" <%= @controller.controller_path == 'admin/product_comments' ? 'active' : '' %>  "><a href="/admin/product_comments">评论管理</a></li>
                  <li class=" <%= @controller.controller_path == 'admin/product_contacts' ? 'active' : '' %>  "><a href="/admin/product_contacts">咨询管理</a></li>
                </ul>
                <div class="clear">   </div>
              </div>
              <% if current_user && current_user.is_admim? %>
                <div class="secondary-navigation">
                  <ul>   
                    <li class="first <%= @controller.controller_path == 'admin/admin_products' ? 'active' : '' %>  "><%= link_to  '产品管理' ,admin_admin_products_path %></li>
                    <li  class=" <%= @controller.controller_path == 'admin/sorts' ? 'active' : '' %>  "> <%= link_to  '翡翠分类' ,admin_sorts_path %></li>
                    <li class=" <%= @controller.controller_path == 'admin/colors' ? 'active' : '' %>  "><%= link_to  '翡翠种色' ,admin_colors_path %></li>
                    <li class=" <%= @controller.controller_path == 'admin/users' ? 'active' : '' %>  "><%= link_to  '用户管理' ,admin_users_path %></li>      
                    <li class=" <%= @controller.controller_path == 'admin/roles' ? 'active' : '' %>  "><%= link_to  '角色管理 ' ,admin_roles_path %></li>
                    <li class=" <%= @controller.controller_path == 'admin/permissions' ? 'active' : '' %>  "><%= link_to  '权限管理 ' ,admin_permissions_path %></li>
                    <li class=" <%= @controller.controller_path == 'admin/categories' ? 'active' : '' %>  "> <%= link_to  '文章分类' ,admin_categories_path   %></li>
                    <li class=" <%= @controller.controller_path == 'admin/admin_articles' ? 'active' : '' %>  "><%= link_to  '文章管理' ,admin_admin_articles_path   %></li>
                    <li class=" <%= @controller.controller_path == 'admin/basetables' ? 'active' : '' %>  "><%= link_to  '信息管理' ,admin_basetables_path   %></li>
                    <li class=" <%= @controller.controller_path == 'admin/admin_helpers' ? 'active' : '' %>  "><%= link_to  '数据管理' ,admin_admin_helpers_path   %></li>
                    <li class=" <%= @controller.controller_path == 'admin/mail_settings' ? 'active' : '' %>  "><%= link_to  '邮件设置' ,admin_mail_settings_path   %></li>
                  </ul>
                  <div class="clear">   </div>
                </div>
                <div class="secondary-navigation">
                  <ul>
                    <li class=" <%= @controller.controller_path == 'admin/orders' ? 'active' : '' %>  "><%= link_to  '订单管理' ,admin_orders_path   %></li>
                    <li class=" <%= @controller.controller_path == 'admin/contacts' ? 'active' : '' %>  "><%= link_to  '咨询管理' ,admin_contacts_path   %></li>
                     <li class=" <%= @controller.controller_path == 'admin/webs' ? 'active' : '' %>  "><%= link_to  '外部文章管理' ,admin_webs_path   %></li>
                  </ul>
                  <div class="clear">   </div>
                </div>
              <% end %>
              <div class="content">
                <%= yield %>
              </div>
            </div>
            
            <div id="footer">
              <div class="block">
                <p>Copyright &copy; 2009 jadejade.cn<p>
              </div>
              
            </div>
          </div>
          <div id="sidebar">
            <div class="block">
              <h3>欢迎使用翡翠管理系统</h3>
              <div class="content">
                <p>发布商品时请注明商品信息，与卖家信息！对于虚假信息将给于删除！</p>
              </div>
              
            </div>
            <div class="block">
              <h3>种类列表</h3>
              <ul class="navigation">
                <%Sort.find(:all).each do |sort|%>
                  <li><%= link_to sort.name ,"products?keywords=#{to_seo(sort.name)}#block-tables" %></li>
                <%end%>              
              </ul>
            </div>
            <div class="block">
              <h3>颜色列表</h3>
              <ul class="navigation">
                <%Color.find(:all).each do |color|%>
                  <li><%= link_to color.name ,"products?keywords=#{CGI::escape(color.name)}#block-tables" %></li>
                <%end%>
              </ul>
              
            </div>
            <div class="block notice">
              <h4>如有意见请与管理员发邮件 </h4>
              <p>产品正维护中，如给您带来的不便还请见谅！或者您有好的建议也可以们联系，同时也欢迎投资者或商家加入有我们！</p>
            </div>
            <div class="block">
              <div class="sidebar-block">
                <h4>联系我们</h4>
                
                <p>电话：15000482567<br />
                  邮件：haofeicui@126.com<br />
                  QQ： 601259096
                </p>
              </div>
            </div>
          </div>
          <div class="clear"></div>
        </div>
      </div>
      
      
    </div>
  </body>
</html>
